//Author: Domien Nowicki

#ifndef CLOCKWIDGET_H
#define CLOCKWIDGET_H

#include <QBasicTimer>
#include <QTimerEvent>
#include <QLCDNumber>
#include "Clock.h"


class ClockWidget: public QLCDNumber, public Clock
{
	Q_OBJECT
public:
	// Constructor
	ClockWidget(QWidget *parent=0, ClockType type=ASCENDING);

	// Destructor
	virtual ~ClockWidget();

	// Overloaded operations
	virtual void Start(int newTime=0);
	virtual void Stop();
	
protected:
	// Qt timer event
	virtual void timerEvent(QTimerEvent *e);

	// Overloaded functions from Clock
	virtual void Timeout();
	virtual void UpdateDisplay();

signals:
	void Timedout();

private:

	QBasicTimer timer;
};

#endif //CLOCKWIDGET_H
